﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace 计科2111林开心
{
    public partial class _1_4 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            ListBox2.Items.Add(ListBox1.SelectedItem);
            ListBox1.Items.RemoveAt(ListBox1.SelectedIndex);
        }

        protected void Button3_Click(object sender, EventArgs e)
        {
            ListBox1.Items.Add(ListBox2.SelectedItem);
            ListBox2.Items.RemoveAt(ListBox2.SelectedIndex);
        }

        protected void Button2_Click(object sender, EventArgs e)
        {
            int n = ListBox2.Items.Count;
            for (int i = ListBox2.Items.Count - 1; i >= 0; i--)
            {
                ListBox1.Items.Add(ListBox2.Items[i]);
                ListBox2.Items.RemoveAt(i);

            }
        }

        protected void Button4_Click(object sender, EventArgs e)
        {

            
            for (int i = ListBox1.Items.Count-1; i>=0; i--)
            {
                ListBox2.Items.Add(ListBox1.Items[i]);
                ListBox1.Items.RemoveAt(i);

            }
        }
    }
}